# build
FROM node:latest AS builder

WORKDIR /build
COPY ./ ./

RUN ls -l

# 编译项目
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g pnpm
RUN pnpm install
RUN pnpm run build

# web
FROM nginx:latest

COPY ./nginx.conf /etc/nginx/nginx.conf

# 拷贝项目
COPY --from=builder /build/dist/ /var/www/html